<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>user表</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript" src="./public/js/jquery-3.1.1.min.js"></script>
    </head>
    <body>
        <a href="index.php?m=index&c=user&c=register">添加</a><br/>
        <table border="1">
            <tr>
                <td>编号</td>
                <td>姓名</td>
                <td>密码</td>
                <td>昵称</td>
                <td>邮箱</td>
                <td>电话</td>
                
            </tr>
            {foreach from=$list1 key=$k item=$v}
            <tr>
                <td id="id">{$v.id}</td>
                <td>{$v.name}</td>
                <td>{$v.content}</td>
                <td>{$v.add_time}</td>
                <td>{$v.click}</td>
                <td><a href="javascript:;" class="delete">删除</a>|<a href="index.php?m=index&c=user&a=update&id={$v.id}">修改</a></td>
            </tr>
            {/foreach}
            </table>
            <a href="index.php?m=index&c=user&a=list1$page=1">首页</a>
            {if $page > 1}
            <a href="index.php?m=index&c=user&a=list1&page={$page-1}">上一页</a>
            {/if}
            {if $page < $pagecount}
            <a href="index.php?m=index&c=user&a=list1&page={$page+1}">下一页</a>
            {/if}
            <a href="index.php?m=index&c=user&a=list1&page={$pagecount}">尾页</a>
            <script tppe="text/script">
                {literal}
                $(".delete").click(function(){
                    var id=$("#id").html();
                    $.ajax({
                        type:"get",
                        url:"./index.php?m=index&c=user&a=list1",
                        data:{id:id},
                      success:function(a){
                 if(a==1){
                   alert("删除成功"); 
                   location.reload() 

                 }else{
                    alert("删除失败");
                 }
             }        
                    })                    
                });
                
        {/literal}
            </script>
    </body>
</html>
